package com.hq.door.dto;

import java.sql.Timestamp;

import com.hq.door.pojo.TClass;

public class DClass {
	private Integer id;
	/*
	 * private TTeacher TTeacher; private TMajor TMajor;
	 */
	private String teachername;
	private String majorname;
	private String institutename;
	private String name;
	private String code;
	private Timestamp modifiedTime;
	private Integer modifiedBy;
	private String grade;

	// private Set<TStudent> TStudents = new HashSet<TStudent>(0);

	public DClass() {
		// TODO Auto-generated constructor stub
	}

	public String getTeachername() {
		return teachername;
	}

	public void setTeachername(String teachername) {
		this.teachername = teachername;
	}

	public String getMajorname() {
		return majorname;
	}

	public void setMajorname(String majorname) {
		this.majorname = majorname;
	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public Timestamp getModifiedTime() {
		return modifiedTime;
	}

	public void setModifiedTime(Timestamp modifiedTime) {
		this.modifiedTime = modifiedTime;
	}

	public Integer getModifiedBy() {
		return modifiedBy;
	}

	public void setModifiedBy(Integer modifiedBy) {
		this.modifiedBy = modifiedBy;
	}

	public String getGrade() {
		return grade;
	}

	public void setGrade(String grade) {
		this.grade = grade;
	}
	public String getInstitutename() {
		return institutename;
	}
	
	public void setInstitutename(String institutename) {
		this.institutename = institutename;
	}

	@Override
	public String toString() {
		return "DClass [id=" + id + ", name=" + name + ", code=" + code
				+ ", modifiedTime=" + modifiedTime + ", modifiedBy="
				+ modifiedBy + ", grade=" + grade + "]";
	}

	
	public void POToDTO(TClass tClass) {
		this.id = tClass.getId();
		this.name= tClass.getName();
		this.code=tClass.getCode();
		this.modifiedTime=tClass.getModifiedTime();
		this.modifiedBy=tClass.getModifiedBy();
		this.grade=tClass.getGrade();
		this.majorname = tClass.getTMajor().getName();
		this.teachername = tClass.getTTeacher().getName();
		this.institutename=(tClass.getTMajor().getTInstitute().getName());
	}
	
	public DClass getClass(TClass tClass) {
		this.id = tClass.getId();
		this.name= tClass.getName();
		this.code=tClass.getCode();
		this.modifiedTime=tClass.getModifiedTime();
		this.modifiedBy=tClass.getModifiedBy();
		this.grade=tClass.getGrade();
		this.majorname = tClass.getTMajor().getName();
		this.teachername = tClass.getTTeacher().getName();
		this.institutename=(tClass.getTMajor().getTInstitute().getName());
		return this;
	}
	
	

}
